package com.yhally.seata.order.feign;

import cn.wangyu.tcc.record.domain.TransactionalRecord;
import com.baomidou.mybatisplus.extension.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author wangyu
 * @version 1.0
 * @date 2022/5/24 0:22
 */
@FeignClient(value = "seata-transaction_record")
@RequestMapping("/transaction/record")
public interface TransactionRecordFeign {

    /**
     * <p>描述: 添加
     * <p>开发者: wangyu
     * <p>时间: 2022/5/24 0:30
     *
     * @param record
     * @return R<TransactionalRecord>
     */
    @PostMapping("/")
    R<TransactionalRecord> add(TransactionalRecord record);

    /**
     * <p>描述: 获取
     * <p>开发者: wangyu
     * <p>时间: 2022/5/24 0:30
     *
     * @param xid
     * @return R<TransactionalRecord>
     */
    @GetMapping("/getByXid")
    R<TransactionalRecord> getByXid(@RequestParam("xid")String xid);
}
